package com.lg.data.controller;

import com.lg.data.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
public class Test2Controller {
    ////TestService 的初始化是由spring IOC进行初始化
    //java 多态，封装，继承
   



    @RequestMapping(value = "test2" , method = RequestMethod.GET)
    @ResponseBody
    public Map getData(){
        Map<String,Object> map =new HashMap<>(16);

        map.put("code",0);
        System.out.println("Test2Controller的代码");
        map.put("msg","第一次实验");
        return map;
    }
}
